package com.CodingInn.code.pojo;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Component;

/**
 * Aware接口:帮我们装配Spring底层的一些组件
 */
//@Component
public class Cat2 implements InitializingBean {
	private String catName = "tomcat";

	private ApplicationContext context;

	public Cat2() {
		System.out.println("cat创建");
	}

	public String getCatName() {
		return catName;
	}

	public void setCatName(String catName) {
		this.catName = catName;
	}

	public ApplicationContext getContext() {
		return context;
	}

	public void setContext(ApplicationContext context) {
		this.context = context;
	}


	@Override
	public void afterPropertiesSet() throws Exception {
		System.out.println("init");
	}
}
